
import React, { Component } from 'react';
import { Actions } from 'react-native-router-flux'
import {
  StyleSheet,
  View,
  Text,
  FlatList,
} from 'react-native';
import Colors from '../../assets/colors'
import List from './table'
import Loading from '../../components/loading/loading'

export default class TasksList extends Component<{}> {

  render() {

    const { pageSize,pageChange,next,prev,last,page, loading,
      list, query ,getTaskId,cleanData,tableLastPage,sureJump,
      tableNextPage,change,prjname,selectRowData,thisTextChange,search} = this.props

    return (
      <View style={styles.container}>
          {
            loading?<Loading />:
                <FlatList
                    data={[
                      {key: 0, title: 'Test'}
                    ]}
                    renderItem={({item}) => <List
                      prjname = {prjname} selectRowData = {selectRowData} thisTextChange = {thisTextChange} search = {search}
                     next = {next} prev = {prev} last = {last} page = {page} pageChange={pageChange}
                     query={query} list={list} {...item} getTaskId={getTaskId} cleanData={cleanData} pageSize={pageSize}
                     tableLastPage={tableLastPage} tableNextPage={tableNextPage} change={change} sureJump={sureJump}/>}
                />
          }
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: 22
  },
  item: {
    padding: 10,
    fontSize: 18,
    height: 4400,
  },
});




